import request from '@/utils/request'

// 查询食谱管理列表
export function listRecipe(query) {
  return request({
    url: '/manage/recipe/list',
    method: 'get',
    params: query
  })
}

// 查询食谱管理详细
export function getRecipe(recipeId) {
  return request({
    url: '/manage/recipe/' + recipeId,
    method: 'get'
  })
}

// 新增食谱管理
export function addRecipe(data) {
  return request({
    url: '/manage/recipe',
    method: 'post',
    data: data
  })
}

// 修改食谱管理
export function updateRecipe(data) {
  return request({
    url: '/manage/recipe',
    method: 'put',
    data: data
  })
}

// 删除食谱管理
export function delRecipe(recipeId) {
  return request({
    url: '/manage/recipe/' + recipeId,
    method: 'delete'
  })
}

// 删除食谱管理
export function batchUpdateRecipe(recipeId) {
  return request({
    url: '/manage/recipe/' + recipeId,
    method: 'put'
  })
}

// 查询评论列表
export function listComment(recipeId) {
  return request({
    url: '/manage/comment/recipe/' + recipeId,
    method: 'get'
  })
}

// 新增评论
export function insertComment(data) {
  return request({
    url: '/manage/comment/recipe/addComment',
    method: 'post',
    data: data
  })
}
